let request_url = $request.url;
let request_method = $request.method;
if (request_method == 'POST') {
    let body = $request.body;
    body = new URLSearchParams(body);
    if (body.has("userId")) {
        body.set("userId", $argument.account_id);
    }
    if (body.has("phone")) {
         body.set("phone", $argument.phone);
    }
    if (body.has("userPhone")) {
         body.set("userPhone", $argument.phone);
    }
    $done({body: body.toString()});
} else if (request_method == 'GET') {
    request_url = new URL(request_url);
    let params = request_url.searchParams;
    if (params.has("userId")) {
        params.set("userId", $argument.account_id);
    }
    if (params.has("phone")) {
        params.set("phone", $argument.phone);
    }
    if (params.has("userPhone")) {
         params.set("userPhone", $argument.phone);
    }
    $done({url: request_url.pathname+request_url.search});
} else {
    $done({});
}
